package banco.entidades;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries({
	@NamedQuery(
			name="findByLoginSenha",
			query="select u from Usuario u where u.login = :login and u.senha = :senha"),
	@NamedQuery(
			name="findByConta",
			query="select u from Usuario u where u.conta.id = :conta")
})
public class Usuario implements Serializable{
	private static final long serialVersionUID = -4410124168735130650L;

	private int id;
	private String login;
	private String nome;
	private String senha;
	Conta conta;
	
	public Usuario() {
		super();
	}
	
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	public Conta getConta() {
		return conta;
	}

	public void setConta(Conta conta) {
		this.conta = conta;
	}

}
